﻿// Decompiled with JetBrains decompiler
// Type: MCM.Implementation.FluentBuilder.Models.BaseDefaultSettingsPropertyBuilder`1
// Assembly: MCMv5, Version=5.10.2.0, Culture=neutral, PublicKeyToken=null
// MVID: 7AB326B9-B2B4-41C2-9177-68E944071101
// Assembly location: D:\steam\steamapps\workshop\content\261550\2859238197\bin\Win64_Shipping_Client\MCMv5.dll

using MCM.Abstractions;
using MCM.Abstractions.FluentBuilder;
using MCM.Common;
using System.Collections.Generic;

#nullable enable
namespace MCM.Implementation.FluentBuilder.Models
{
  internal abstract class BaseDefaultSettingsPropertyBuilder<TSettingsPropertyBuilder> : 
    ISettingsPropertyBuilder<TSettingsPropertyBuilder>,
    ISettingsPropertyBuilder,
    IPropertyDefinitionBase,
    IPropertyDefinitionWithId
    where TSettingsPropertyBuilder : ISettingsPropertyBuilder
  {
    protected TSettingsPropertyBuilder SettingsPropertyBuilder { get; set; } = default (TSettingsPropertyBuilder);

    public string Name { get; }

    public string Id { get; }

    public IRef PropertyReference { get; }

    public string DisplayName => this.Name;

    public int Order { get; private set; }

    public bool RequireRestart { get; private set; }

    public string HintText { get; private set; } = string.Empty;

    protected BaseDefaultSettingsPropertyBuilder(string id, string name, IRef @ref)
    {
      this.Id = id;
      this.Name = name;
      this.PropertyReference = @ref;
    }

    public TSettingsPropertyBuilder SetOrder(int value)
    {
      this.Order = value;
      return this.SettingsPropertyBuilder;
    }

    public TSettingsPropertyBuilder SetRequireRestart(bool value)
    {
      this.RequireRestart = value;
      return this.SettingsPropertyBuilder;
    }

    public TSettingsPropertyBuilder SetHintText(string value)
    {
      this.HintText = value;
      return this.SettingsPropertyBuilder;
    }

    public abstract IEnumerable<IPropertyDefinitionBase> GetDefinitions();
  }
}
